package carltechnology.com.mahjonggame.views.impl;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import butterknife.ButterKnife;
import butterknife.InjectView;
import carltechnology.com.mahjonggame.R;
import carltechnology.com.mahjonggame.base.MyApplication;
import carltechnology.com.mahjonggame.presenter.IMahjongGameDetailPresenter;
import carltechnology.com.mahjonggame.presenter.impl.MahjongGameDetailPresenter;
import carltechnology.com.mahjonggame.views.IMahjongGameDetailView;

/**
 * Created by WZTCM on 2016/6/14.
 */
public class MahjongGameDetailFragment extends Fragment implements IMahjongGameDetailView{
    private IMahjongGameDetailPresenter presenter;
    @InjectView(R.id.mahjonggame_detail_fragment_recycleview)
    RecyclerView recyclerView;

    public MahjongGameDetailFragment() {

    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view
                = inflater.inflate(R.layout.mahjonggame_content_detail_chosen_fragment,container,false);
        ButterKnife.inject(this,view);
        presenter = MahjongGameDetailPresenter.getInstance(this,
                MyApplication.getDataPool().getMahjongGameMode().getId());
        System.out.println("detail begin");
        return view;
    }

    @Override
    public void onResume() {
        super.onResume();

    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        presenter.endFragment();
    }

    @Override
    public RecyclerView getRecycleView() {
        return recyclerView;
    }
}
